{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Panel Data and Fixed Effects\n",
    "\n",
    "## Controlling What you Cannot See\n",
    "\n",
    "Methods like propensity score, linear regression and matching are very good at controlling for confounding in non-random data, but they rely on a key assumption: conditional unconfoundedness\n",
    "\n",
    "$\n",
    "(Y_0, Y_1) \\perp T | X\n",
    "$\n",
    "\n",
    "To put it in words, they require that all the confounders are known and measured, so that we can condition on them and make the treatment as good as random. One major issue with this is that sometimes we simply can't measure a confounder. For instance, take a classical labor economics problem of figuring out the impact of marriage on men's earnings. It's a well known fact in Economics that married men earn more than single men. What is not as clear is if this relationship is causal or not. It could be that more educated people are both more likely to marry and more likely to have a high earnings job, which would mean that education is a confounder of the effect of marriage on earnings. For this confounder, we could measure the education of the person in the study and run a regression controlling for that. But another confounder could be beauty. It could be that more handsome men are both more likely to get married and more likely to have a high paying job. Unfortunately, beauty is one of those characteristics like intelligence. It's something we can't measure very well.  \n",
    "\n",
    "This puts us in a difficult situation, because if we have unmeasured confounders, we have bias. One way to deal with this is with instrumental variables, like we've seen before. But coming up with good instruments it's no easy task and requires a lot of creativity. Here, let's look at an alternative that takes advantage of time or the temporal structure of data. \n",
    "\n",
    "The idea is to use **panel data**. Panel data is when we have **observations on the same individual for multiple periods of time**. Panel data formats are very common in the industry, where they keep records of customer behavior for the same customer and for multiple time periods. The reason we can leverage panel data is because we can compare the same unit before and after the treatment and see how they behave with it. Before we dive in the math, let's see how this makes intuitive sense."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import warnings\n",
    "warnings.filterwarnings('ignore')\n",
    "\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "from matplotlib import style\n",
    "from matplotlib import pyplot as plt\n",
    "import statsmodels.formula.api as smf\n",
    "import graphviz as gr\n",
    "\n",
    "from linearmodels.panel import PanelOLS\n",
    "\n",
    "\n",
    "%matplotlib inline\n",
    "pd.set_option(\"display.max_columns\", 6)\n",
    "style.use(\"fivethirtyeight\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "First, let's take a look at the causal graph that we have once we include multiple observations of the same unit across time. Suppose we have a situation where marriage at the first time causes income at the same time and subsequent marital status. This is also true for times 2 and 3. Also, suppose that beauty is the same across all time periods (a bold statement, but reasonable if time is just a few years) and it causes both marriage and income."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n",
       " -->\n",
       "<!-- Title: %3 Pages: 1 -->\n",
       "<svg width=\"308pt\" height=\"332pt\"\n",
       " viewBox=\"0.00 0.00 307.94 332.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 328)\">\n",
       "<title>%3</title>\n",
       "<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-328 303.9355,-328 303.9355,4 -4,4\"/>\n",
       "<!-- Marriage_1 -->\n",
       "<g id=\"node1\" class=\"node\">\n",
       "<title>Marriage_1</title>\n",
       "<ellipse fill=\"none\" stroke=\"#000000\" cx=\"139.4677\" cy=\"-234\" rx=\"51.2156\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"139.4677\" y=\"-229.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">Marriage_1</text>\n",
       "</g>\n",
       "<!-- Income_1 -->\n",
       "<g id=\"node2\" class=\"node\">\n",
       "<title>Income_1</title>\n",
       "<ellipse fill=\"none\" stroke=\"#000000\" cx=\"62.4677\" cy=\"-162\" rx=\"45.4355\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"62.4677\" y=\"-157.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">Income_1</text>\n",
       "</g>\n",
       "<!-- Marriage_1&#45;&gt;Income_1 -->\n",
       "<g id=\"edge1\" class=\"edge\">\n",
       "<title>Marriage_1&#45;&gt;Income_1</title>\n",
       "<path fill=\"none\" stroke=\"#000000\" d=\"M121.2198,-216.937C111.2712,-207.6344 98.8003,-195.9733 87.9105,-185.7906\"/>\n",
       "<polygon fill=\"#000000\" stroke=\"#000000\" points=\"90.0138,-182.9656 80.319,-178.6921 85.2328,-188.0786 90.0138,-182.9656\"/>\n",
       "</g>\n",
       "<!-- Marriage_2 -->\n",
       "<g id=\"node3\" class=\"node\">\n",
       "<title>Marriage_2</title>\n",
       "<ellipse fill=\"none\" stroke=\"#000000\" cx=\"177.4677\" cy=\"-162\" rx=\"51.2156\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"177.4677\" y=\"-157.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">Marriage_2</text>\n",
       "</g>\n",
       "<!-- Marriage_1&#45;&gt;Marriage_2 -->\n",
       "<g id=\"edge2\" class=\"edge\">\n",
       "<title>Marriage_1&#45;&gt;Marriage_2</title>\n",
       "<path fill=\"none\" stroke=\"#000000\" d=\"M148.861,-216.2022C153.2,-207.981 158.4461,-198.041 163.2546,-188.9301\"/>\n",
       "<polygon fill=\"#000000\" stroke=\"#000000\" points=\"166.4785,-190.3201 168.0508,-179.8425 160.2878,-187.0527 166.4785,-190.3201\"/>\n",
       "</g>\n",
       "<!-- Income_2 -->\n",
       "<g id=\"node4\" class=\"node\">\n",
       "<title>Income_2</title>\n",
       "<ellipse fill=\"none\" stroke=\"#000000\" cx=\"45.4677\" cy=\"-90\" rx=\"45.4355\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"45.4677\" y=\"-85.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">Income_2</text>\n",
       "</g>\n",
       "<!-- Marriage_2&#45;&gt;Income_2 -->\n",
       "<g id=\"edge3\" class=\"edge\">\n",
       "<title>Marriage_2&#45;&gt;Income_2</title>\n",
       "<path fill=\"none\" stroke=\"#000000\" d=\"M149.4739,-146.7307C129.6083,-135.8949 102.774,-121.258 81.3385,-109.5658\"/>\n",
       "<polygon fill=\"#000000\" stroke=\"#000000\" points=\"82.9733,-106.4708 72.5184,-104.7549 79.6213,-112.6161 82.9733,-106.4708\"/>\n",
       "</g>\n",
       "<!-- Marriage_3 -->\n",
       "<g id=\"node5\" class=\"node\">\n",
       "<title>Marriage_3</title>\n",
       "<ellipse fill=\"none\" stroke=\"#000000\" cx=\"215.4677\" cy=\"-90\" rx=\"51.2156\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"215.4677\" y=\"-85.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">Marriage_3</text>\n",
       "</g>\n",
       "<!-- Marriage_2&#45;&gt;Marriage_3 -->\n",
       "<g id=\"edge4\" class=\"edge\">\n",
       "<title>Marriage_2&#45;&gt;Marriage_3</title>\n",
       "<path fill=\"none\" stroke=\"#000000\" d=\"M186.861,-144.2022C191.2,-135.981 196.4461,-126.041 201.2546,-116.9301\"/>\n",
       "<polygon fill=\"#000000\" stroke=\"#000000\" points=\"204.4785,-118.3201 206.0508,-107.8425 198.2878,-115.0527 204.4785,-118.3201\"/>\n",
       "</g>\n",
       "<!-- Income_3 -->\n",
       "<g id=\"node6\" class=\"node\">\n",
       "<title>Income_3</title>\n",
       "<ellipse fill=\"none\" stroke=\"#000000\" cx=\"254.4677\" cy=\"-18\" rx=\"45.4355\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"254.4677\" y=\"-13.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">Income_3</text>\n",
       "</g>\n",
       "<!-- Marriage_3&#45;&gt;Income_3 -->\n",
       "<g id=\"edge5\" class=\"edge\">\n",
       "<title>Marriage_3&#45;&gt;Income_3</title>\n",
       "<path fill=\"none\" stroke=\"#000000\" d=\"M225.1082,-72.2022C229.6082,-63.8944 235.059,-53.8316 240.0363,-44.6427\"/>\n",
       "<polygon fill=\"#000000\" stroke=\"#000000\" points=\"243.1177,-46.3025 244.803,-35.8425 236.9626,-42.9685 243.1177,-46.3025\"/>\n",
       "</g>\n",
       "<!-- Beauty -->\n",
       "<g id=\"node7\" class=\"node\">\n",
       "<title>Beauty</title>\n",
       "<ellipse fill=\"none\" stroke=\"#000000\" cx=\"178.4677\" cy=\"-306\" rx=\"35.3129\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"178.4677\" y=\"-301.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">Beauty</text>\n",
       "</g>\n",
       "<!-- Beauty&#45;&gt;Marriage_1 -->\n",
       "<g id=\"edge6\" class=\"edge\">\n",
       "<title>Beauty&#45;&gt;Marriage_1</title>\n",
       "<path fill=\"none\" stroke=\"#000000\" d=\"M169.0269,-288.5708C164.4957,-280.2055 158.9666,-269.998 153.9215,-260.6839\"/>\n",
       "<polygon fill=\"#000000\" stroke=\"#000000\" points=\"156.9329,-258.8948 149.0925,-251.7689 150.7779,-262.2288 156.9329,-258.8948\"/>\n",
       "</g>\n",
       "<!-- Beauty&#45;&gt;Income_1 -->\n",
       "<g id=\"edge9\" class=\"edge\">\n",
       "<title>Beauty&#45;&gt;Income_1</title>\n",
       "<path fill=\"none\" stroke=\"#000000\" d=\"M147.7259,-297.1258C125.3066,-289.0322 96.0559,-274.7957 79.4677,-252 66.581,-234.2909 62.64,-209.5853 61.7491,-190.5381\"/>\n",
       "<polygon fill=\"#000000\" stroke=\"#000000\" points=\"65.2442,-190.2692 61.5312,-180.3463 58.2458,-190.4189 65.2442,-190.2692\"/>\n",
       "</g>\n",
       "<!-- Beauty&#45;&gt;Marriage_2 -->\n",
       "<g id=\"edge7\" class=\"edge\">\n",
       "<title>Beauty&#45;&gt;Marriage_2</title>\n",
       "<path fill=\"none\" stroke=\"#000000\" d=\"M187.1872,-288.491C191.8437,-278.1547 197.0937,-264.6547 199.4677,-252 202.4179,-236.2743 202.5435,-231.7016 199.4677,-216 197.7054,-207.0032 194.4367,-197.6139 190.948,-189.2358\"/>\n",
       "<polygon fill=\"#000000\" stroke=\"#000000\" points=\"194.0829,-187.6709 186.8286,-179.9491 187.6841,-190.5094 194.0829,-187.6709\"/>\n",
       "</g>\n",
       "<!-- Beauty&#45;&gt;Income_2 -->\n",
       "<g id=\"edge10\" class=\"edge\">\n",
       "<title>Beauty&#45;&gt;Income_2</title>\n",
       "<path fill=\"none\" stroke=\"#000000\" d=\"M148.0237,-296.7162C122.9313,-288.0074 87.3829,-273.1426 61.4677,-252 30.6793,-226.8815 20.8642,-217.7517 8.4677,-180 3.476,-164.7986 3.734,-159.2837 8.4677,-144 11.6451,-133.7413 17.5185,-123.6981 23.6645,-115.1092\"/>\n",
       "<polygon fill=\"#000000\" stroke=\"#000000\" points=\"26.5293,-117.1245 29.8116,-107.051 20.9637,-112.8789 26.5293,-117.1245\"/>\n",
       "</g>\n",
       "<!-- Beauty&#45;&gt;Marriage_3 -->\n",
       "<g id=\"edge8\" class=\"edge\">\n",
       "<title>Beauty&#45;&gt;Marriage_3</title>\n",
       "<path fill=\"none\" stroke=\"#000000\" d=\"M191.4291,-289.2245C198.9308,-278.9172 208.115,-265.1982 214.4677,-252 229.0372,-221.7308 232.2949,-213.1924 237.4677,-180 239.9315,-164.1908 240.5435,-159.7016 237.4677,-144 235.7054,-135.0032 232.4367,-125.6139 228.948,-117.2358\"/>\n",
       "<polygon fill=\"#000000\" stroke=\"#000000\" points=\"232.0829,-115.6709 224.8286,-107.9491 225.6841,-118.5094 232.0829,-115.6709\"/>\n",
       "</g>\n",
       "<!-- Beauty&#45;&gt;Income_3 -->\n",
       "<g id=\"edge11\" class=\"edge\">\n",
       "<title>Beauty&#45;&gt;Income_3</title>\n",
       "<path fill=\"none\" stroke=\"#000000\" d=\"M199.1025,-291.1171C211.326,-281.2928 226.1906,-267.4177 235.4677,-252 269.7141,-195.0857 266.4966,-173.8147 275.4677,-108 277.6287,-92.1466 278.4179,-87.7257 275.4677,-72 273.7881,-63.0465 270.6687,-53.67 267.3385,-45.2901\"/>\n",
       "<polygon fill=\"#000000\" stroke=\"#000000\" points=\"270.526,-43.8414 263.4059,-35.9958 264.0794,-46.5692 270.526,-43.8414\"/>\n",
       "</g>\n",
       "</g>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<graphviz.dot.Digraph at 0x1a16cea048>"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "g = gr.Digraph()\n",
    "g.edge(\"Marriage_1\", \"Income_1\")\n",
    "g.edge(\"Marriage_1\", \"Marriage_2\")\n",
    "g.edge(\"Marriage_2\", \"Income_2\")\n",
    "g.edge(\"Marriage_2\", \"Marriage_3\")\n",
    "g.edge(\"Marriage_3\", \"Income_3\")\n",
    "\n",
    "g.edge(\"Beauty\", \"Marriage_1\")\n",
    "g.edge(\"Beauty\", \"Marriage_2\")\n",
    "g.edge(\"Beauty\", \"Marriage_3\")\n",
    "\n",
    "g.edge(\"Beauty\", \"Income_1\")\n",
    "g.edge(\"Beauty\", \"Income_2\")\n",
    "g.edge(\"Beauty\", \"Income_3\")\n",
    "\n",
    "g"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Remember that we cannot control beauty, since we can't measure it. But we can still use the panel structure so it is not a problem anymore. The idea is that we can see beauty - and any other attribute that is constant across time - as the defining aspects of a person. And although we can't control them directly, we can control for the individual itself."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n",
       " -->\n",
       "<!-- Title: %3 Pages: 1 -->\n",
       "<svg width=\"308pt\" height=\"332pt\"\n",
       " viewBox=\"0.00 0.00 307.94 332.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 328)\">\n",
       "<title>%3</title>\n",
       "<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-328 303.9355,-328 303.9355,4 -4,4\"/>\n",
       "<!-- Marriage_1 -->\n",
       "<g id=\"node1\" class=\"node\">\n",
       "<title>Marriage_1</title>\n",
       "<ellipse fill=\"none\" stroke=\"#000000\" cx=\"139.4677\" cy=\"-234\" rx=\"51.2156\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"139.4677\" y=\"-229.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">Marriage_1</text>\n",
       "</g>\n",
       "<!-- Income_1 -->\n",
       "<g id=\"node2\" class=\"node\">\n",
       "<title>Income_1</title>\n",
       "<ellipse fill=\"none\" stroke=\"#000000\" cx=\"62.4677\" cy=\"-162\" rx=\"45.4355\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"62.4677\" y=\"-157.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">Income_1</text>\n",
       "</g>\n",
       "<!-- Marriage_1&#45;&gt;Income_1 -->\n",
       "<g id=\"edge1\" class=\"edge\">\n",
       "<title>Marriage_1&#45;&gt;Income_1</title>\n",
       "<path fill=\"none\" stroke=\"#000000\" d=\"M121.2198,-216.937C111.2712,-207.6344 98.8003,-195.9733 87.9105,-185.7906\"/>\n",
       "<polygon fill=\"#000000\" stroke=\"#000000\" points=\"90.0138,-182.9656 80.319,-178.6921 85.2328,-188.0786 90.0138,-182.9656\"/>\n",
       "</g>\n",
       "<!-- Marriage_2 -->\n",
       "<g id=\"node3\" class=\"node\">\n",
       "<title>Marriage_2</title>\n",
       "<ellipse fill=\"none\" stroke=\"#000000\" cx=\"177.4677\" cy=\"-162\" rx=\"51.2156\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"177.4677\" y=\"-157.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">Marriage_2</text>\n",
       "</g>\n",
       "<!-- Marriage_1&#45;&gt;Marriage_2 -->\n",
       "<g id=\"edge2\" class=\"edge\">\n",
       "<title>Marriage_1&#45;&gt;Marriage_2</title>\n",
       "<path fill=\"none\" stroke=\"#000000\" d=\"M148.861,-216.2022C153.2,-207.981 158.4461,-198.041 163.2546,-188.9301\"/>\n",
       "<polygon fill=\"#000000\" stroke=\"#000000\" points=\"166.4785,-190.3201 168.0508,-179.8425 160.2878,-187.0527 166.4785,-190.3201\"/>\n",
       "</g>\n",
       "<!-- Income_2 -->\n",
       "<g id=\"node4\" class=\"node\">\n",
       "<title>Income_2</title>\n",
       "<ellipse fill=\"none\" stroke=\"#000000\" cx=\"45.4677\" cy=\"-90\" rx=\"45.4355\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"45.4677\" y=\"-85.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">Income_2</text>\n",
       "</g>\n",
       "<!-- Marriage_2&#45;&gt;Income_2 -->\n",
       "<g id=\"edge3\" class=\"edge\">\n",
       "<title>Marriage_2&#45;&gt;Income_2</title>\n",
       "<path fill=\"none\" stroke=\"#000000\" d=\"M149.4739,-146.7307C129.6083,-135.8949 102.774,-121.258 81.3385,-109.5658\"/>\n",
       "<polygon fill=\"#000000\" stroke=\"#000000\" points=\"82.9733,-106.4708 72.5184,-104.7549 79.6213,-112.6161 82.9733,-106.4708\"/>\n",
       "</g>\n",
       "<!-- Marriage_3 -->\n",
       "<g id=\"node5\" class=\"node\">\n",
       "<title>Marriage_3</title>\n",
       "<ellipse fill=\"none\" stroke=\"#000000\" cx=\"215.4677\" cy=\"-90\" rx=\"51.2156\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"215.4677\" y=\"-85.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">Marriage_3</text>\n",
       "</g>\n",
       "<!-- Marriage_2&#45;&gt;Marriage_3 -->\n",
       "<g id=\"edge4\" class=\"edge\">\n",
       "<title>Marriage_2&#45;&gt;Marriage_3</title>\n",
       "<path fill=\"none\" stroke=\"#000000\" d=\"M186.861,-144.2022C191.2,-135.981 196.4461,-126.041 201.2546,-116.9301\"/>\n",
       "<polygon fill=\"#000000\" stroke=\"#000000\" points=\"204.4785,-118.3201 206.0508,-107.8425 198.2878,-115.0527 204.4785,-118.3201\"/>\n",
       "</g>\n",
       "<!-- Income_3 -->\n",
       "<g id=\"node6\" class=\"node\">\n",
       "<title>Income_3</title>\n",
       "<ellipse fill=\"none\" stroke=\"#000000\" cx=\"254.4677\" cy=\"-18\" rx=\"45.4355\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"254.4677\" y=\"-13.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">Income_3</text>\n",
       "</g>\n",
       "<!-- Marriage_3&#45;&gt;Income_3 -->\n",
       "<g id=\"edge5\" class=\"edge\">\n",
       "<title>Marriage_3&#45;&gt;Income_3</title>\n",
       "<path fill=\"none\" stroke=\"#000000\" d=\"M225.1082,-72.2022C229.6082,-63.8944 235.059,-53.8316 240.0363,-44.6427\"/>\n",
       "<polygon fill=\"#000000\" stroke=\"#000000\" points=\"243.1177,-46.3025 244.803,-35.8425 236.9626,-42.9685 243.1177,-46.3025\"/>\n",
       "</g>\n",
       "<!-- Person (Beauty, Ingeligence...) -->\n",
       "<g id=\"node7\" class=\"node\">\n",
       "<title>Person (Beauty, Ingeligence...)</title>\n",
       "<ellipse fill=\"none\" stroke=\"#000000\" cx=\"178.4677\" cy=\"-306\" rx=\"119.1136\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"178.4677\" y=\"-301.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">Person (Beauty, Ingeligence...)</text>\n",
       "</g>\n",
       "<!-- Person (Beauty, Ingeligence...)&#45;&gt;Marriage_1 -->\n",
       "<g id=\"edge6\" class=\"edge\">\n",
       "<title>Person (Beauty, Ingeligence...)&#45;&gt;Marriage_1</title>\n",
       "<path fill=\"none\" stroke=\"#000000\" d=\"M168.6264,-287.8314C164.205,-279.6688 158.8973,-269.87 154.0292,-260.8827\"/>\n",
       "<polygon fill=\"#000000\" stroke=\"#000000\" points=\"157.0112,-259.0393 149.1708,-251.9134 150.8562,-262.3734 157.0112,-259.0393\"/>\n",
       "</g>\n",
       "<!-- Person (Beauty, Ingeligence...)&#45;&gt;Income_1 -->\n",
       "<g id=\"edge9\" class=\"edge\">\n",
       "<title>Person (Beauty, Ingeligence...)&#45;&gt;Income_1</title>\n",
       "<path fill=\"none\" stroke=\"#000000\" d=\"M129.1653,-289.5102C110.9306,-281.0369 91.7361,-268.8593 79.4677,-252 66.581,-234.2909 62.64,-209.5853 61.7491,-190.5381\"/>\n",
       "<polygon fill=\"#000000\" stroke=\"#000000\" points=\"65.2442,-190.2692 61.5312,-180.3463 58.2458,-190.4189 65.2442,-190.2692\"/>\n",
       "</g>\n",
       "<!-- Person (Beauty, Ingeligence...)&#45;&gt;Marriage_2 -->\n",
       "<g id=\"edge7\" class=\"edge\">\n",
       "<title>Person (Beauty, Ingeligence...)&#45;&gt;Marriage_2</title>\n",
       "<path fill=\"none\" stroke=\"#000000\" d=\"M187.4059,-288.0042C192.0071,-277.733 197.1308,-264.457 199.4677,-252 202.4179,-236.2743 202.5435,-231.7016 199.4677,-216 197.7054,-207.0032 194.4367,-197.6139 190.948,-189.2358\"/>\n",
       "<polygon fill=\"#000000\" stroke=\"#000000\" points=\"194.0829,-187.6709 186.8286,-179.9491 187.6841,-190.5094 194.0829,-187.6709\"/>\n",
       "</g>\n",
       "<!-- Person (Beauty, Ingeligence...)&#45;&gt;Income_2 -->\n",
       "<g id=\"edge10\" class=\"edge\">\n",
       "<title>Person (Beauty, Ingeligence...)&#45;&gt;Income_2</title>\n",
       "<path fill=\"none\" stroke=\"#000000\" d=\"M128.9388,-289.5858C106.8146,-280.7032 81.3158,-268.1928 61.4677,-252 30.6793,-226.8815 20.8642,-217.7517 8.4677,-180 3.476,-164.7986 3.734,-159.2837 8.4677,-144 11.6451,-133.7413 17.5185,-123.6981 23.6645,-115.1092\"/>\n",
       "<polygon fill=\"#000000\" stroke=\"#000000\" points=\"26.5293,-117.1245 29.8116,-107.051 20.9637,-112.8789 26.5293,-117.1245\"/>\n",
       "</g>\n",
       "<!-- Person (Beauty, Ingeligence...)&#45;&gt;Marriage_3 -->\n",
       "<g id=\"edge8\" class=\"edge\">\n",
       "<title>Person (Beauty, Ingeligence...)&#45;&gt;Marriage_3</title>\n",
       "<path fill=\"none\" stroke=\"#000000\" d=\"M192.4781,-287.7759C199.7726,-277.6519 208.4082,-264.5891 214.4677,-252 229.0372,-221.7308 232.2949,-213.1924 237.4677,-180 239.9315,-164.1908 240.5435,-159.7016 237.4677,-144 235.7054,-135.0032 232.4367,-125.6139 228.948,-117.2358\"/>\n",
       "<polygon fill=\"#000000\" stroke=\"#000000\" points=\"232.0829,-115.6709 224.8286,-107.9491 225.6841,-118.5094 232.0829,-115.6709\"/>\n",
       "</g>\n",
       "<!-- Person (Beauty, Ingeligence...)&#45;&gt;Income_3 -->\n",
       "<g id=\"edge11\" class=\"edge\">\n",
       "<title>Person (Beauty, Ingeligence...)&#45;&gt;Income_3</title>\n",
       "<path fill=\"none\" stroke=\"#000000\" d=\"M202.4955,-288.3392C213.9825,-278.7573 227.034,-266.0161 235.4677,-252 269.7141,-195.0857 266.4966,-173.8147 275.4677,-108 277.6287,-92.1466 278.4179,-87.7257 275.4677,-72 273.7881,-63.0465 270.6687,-53.67 267.3385,-45.2901\"/>\n",
       "<polygon fill=\"#000000\" stroke=\"#000000\" points=\"270.526,-43.8414 263.4059,-35.9958 264.0794,-46.5692 270.526,-43.8414\"/>\n",
       "</g>\n",
       "</g>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<graphviz.dot.Digraph at 0x1a16cdceb8>"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "g = gr.Digraph()\n",
    "g.edge(\"Marriage_1\", \"Income_1\")\n",
    "g.edge(\"Marriage_1\", \"Marriage_2\")\n",
    "g.edge(\"Marriage_2\", \"Income_2\")\n",
    "g.edge(\"Marriage_2\", \"Marriage_3\")\n",
    "g.edge(\"Marriage_3\", \"Income_3\")\n",
    "\n",
    "g.edge(\"Person (Beauty, Ingeligence...)\", \"Marriage_1\")\n",
    "g.edge(\"Person (Beauty, Ingeligence...)\", \"Marriage_2\")\n",
    "g.edge(\"Person (Beauty, Ingeligence...)\", \"Marriage_3\")\n",
    "\n",
    "g.edge(\"Person (Beauty, Ingeligence...)\", \"Income_1\")\n",
    "g.edge(\"Person (Beauty, Ingeligence...)\", \"Income_2\")\n",
    "g.edge(\"Person (Beauty, Ingeligence...)\", \"Income_3\")\n",
    "\n",
    "g"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Think about it. We can't measure attributes like beauty and intelligence, but we know that the person who has them is the same individual across time. So, we can create a dummy variable indicating that person and add that to a linear model. This is what we mean when we say we can control for the person itself: we are adding a variable (dummy in this case) that denotes that particular person. When estimating the effect of marriage on income with this person dummy in our model, regression finds the effect of marriage **while keeping the person variable fixed**. Adding this entity dummy is what we call a fixed effect model.\n",
    "\n",
    "\n",
    "## Fixed Effects\n",
    "\n",
    "To make matters more formal, let's first take a look at the data that we have. Following our example, we will try to estimate the effect of marriage on income. Our data contains those 2 variables, `married` and `lwage`, on multiple individuals (`nr`) for multiple years. Note that wage is in log form. In addition to this, we have other controls, like number of hours worked that year, years of education and so on."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>nr</th>\n",
       "      <th>year</th>\n",
       "      <th>black</th>\n",
       "      <th>...</th>\n",
       "      <th>lwage</th>\n",
       "      <th>expersq</th>\n",
       "      <th>occupation</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>13</td>\n",
       "      <td>1980</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>1.197540</td>\n",
       "      <td>1</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>13</td>\n",
       "      <td>1981</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>1.853060</td>\n",
       "      <td>4</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>13</td>\n",
       "      <td>1982</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>1.344462</td>\n",
       "      <td>9</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>13</td>\n",
       "      <td>1983</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>1.433213</td>\n",
       "      <td>16</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>13</td>\n",
       "      <td>1984</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>1.568125</td>\n",
       "      <td>25</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 12 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   nr  year  black  ...     lwage  expersq  occupation\n",
       "0  13  1980      0  ...  1.197540        1           9\n",
       "1  13  1981      0  ...  1.853060        4           9\n",
       "2  13  1982      0  ...  1.344462        9           9\n",
       "3  13  1983      0  ...  1.433213       16           9\n",
       "4  13  1984      0  ...  1.568125       25           5\n",
       "\n",
       "[5 rows x 12 columns]"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from linearmodels.datasets import wage_panel\n",
    "data = wage_panel.load()\n",
    "data.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Generally, the fixed effect model is defined as\n",
    "\n",
    "$\n",
    "y_{it} = \\beta X_{it} + \\gamma U_i + e_{it}\n",
    "$\n",
    "\n",
    "where \\\\(y_{it}\\\\) is the outcome of individual \\\\(i\\\\) at time \\\\(t\\\\), \\\\(X_{it}\\\\) is the vector of variables for individual \\\\(i\\\\) at time \\\\(t\\\\). \\\\(U_i\\\\) is a set of unobservables for individual \\\\(i\\\\). Notice that those unobservables are unchanging through time, hence the lack of the time subscript. Finally,  \\\\(e_{it}\\\\) is the error term. For the education example, \\\\(y_{it}\\\\) is log wages,  \\\\(X_{it}\\\\) are the observable variables that change in time, like marriage and experience and \\\\(U_i\\\\) are the variables that are not observed but constant for each individual, like beauty and intelligence. \n",
    "\n",
    "\n",
    "Now, remember how I've said that using panel data with a fixed effect model is as simple as adding a dummy for the entities. It's true, but in practice, we don't actually do it. Imagine a dataset where we have 1 million customers. If we add one dummy for each of them, we would end up with 1 million columns, which is probably not a good idea. Instead, we use the trick of partitioning the linear regression into 2 separate models. We've seen this before, but now is a good time to recap it. Suppose you have a linear regression model with a set of features \\\\(X_1\\\\) and another set of features \\\\(X_2\\\\).\n",
    "\n",
    "$\n",
    "\\hat{Y} = \\hat{\\beta_1} X_1 + \\hat{\\beta_2} X_2\n",
    "$\n",
    "\n",
    "where \\\\(X_1\\\\) and \\\\(X_1\\\\) are feature matrices (one row per feature and one column per observation) and \\\\(\\hat{\\beta_1}\\\\) and \\\\(\\hat{\\beta_2}\\\\) are row vectors. You can get the exact same \\\\(\\hat{\\beta_1}\\\\) parameter by doing\n",
    "\n",
    "1. regress the the outcome \\\\(y\\\\) on the second set of features \\\\(\\hat{y^*} = \\hat{\\gamma_1} X_2\\\\)\n",
    "2. regress the first set of features on the second \\\\(\\hat{X_1} = \\hat{\\gamma_2} X_2\\\\)\n",
    "3. obtain the residuals \\\\(\\tilde{X}_1 = X_1 - \\hat{X_1}\\\\) and \\\\(\\tilde{y}_1 = y_1 - \\hat{y^*}\\\\)\n",
    "4. regress the residuals of the outcome on the residuals of the features \\\\(\\hat{y} = \\hat{\\beta_1} \\tilde{X}_1\\\\)\n",
    "\n",
    "The parameter from this last regression will be exactly the same as running the regression with all the features. But how exactly does this help us? Well, we can break the estimation of the model with the entity dummies into 2. First, we use the dummies to predict the outcome and the feature. These are steps 1 and 2 above. \n",
    "\n",
    "Now, remember how running a regression on a dummy variable is as simple as estimating the mean for that dummy? If you don't, let's use our data to show how this is true. Let's run a model where we predict wages as a function of the year dummy. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<table class=\"simpletable\">\n",
       "<tr>\n",
       "         <td></td>            <th>coef</th>     <th>std err</th>      <th>t</th>      <th>P>|t|</th>  <th>[0.025</th>    <th>0.975]</th>  \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Intercept</th>       <td>    1.3935</td> <td>    0.022</td> <td>   63.462</td> <td> 0.000</td> <td>    1.350</td> <td>    1.437</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>C(year)[T.1981]</th> <td>    0.1194</td> <td>    0.031</td> <td>    3.845</td> <td> 0.000</td> <td>    0.059</td> <td>    0.180</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>C(year)[T.1982]</th> <td>    0.1782</td> <td>    0.031</td> <td>    5.738</td> <td> 0.000</td> <td>    0.117</td> <td>    0.239</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>C(year)[T.1983]</th> <td>    0.2258</td> <td>    0.031</td> <td>    7.271</td> <td> 0.000</td> <td>    0.165</td> <td>    0.287</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>C(year)[T.1984]</th> <td>    0.2968</td> <td>    0.031</td> <td>    9.558</td> <td> 0.000</td> <td>    0.236</td> <td>    0.358</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>C(year)[T.1985]</th> <td>    0.3459</td> <td>    0.031</td> <td>   11.140</td> <td> 0.000</td> <td>    0.285</td> <td>    0.407</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>C(year)[T.1986]</th> <td>    0.4062</td> <td>    0.031</td> <td>   13.082</td> <td> 0.000</td> <td>    0.345</td> <td>    0.467</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>C(year)[T.1987]</th> <td>    0.4730</td> <td>    0.031</td> <td>   15.232</td> <td> 0.000</td> <td>    0.412</td> <td>    0.534</td>\n",
       "</tr>\n",
       "</table>"
      ],
      "text/plain": [
       "<class 'statsmodels.iolib.table.SimpleTable'>"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mod = smf.ols(\"lwage ~ C(year)\", data=data).fit()\n",
    "mod.summary().tables[1]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Notice how this model is predicting the average income in 1980 to be 1.3935, in 1981 to be 1.5129 (1.3935+0.1194) and so on. Now, if we compute the average by year, we get the exact same result. (Remember that the base year, 1980, is the intercept. So you have to add the intercept to the parameters of the other years to get the mean `lwage` for the year)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "year\n",
       "1980    1.393477\n",
       "1981    1.512867\n",
       "1982    1.571667\n",
       "1983    1.619263\n",
       "1984    1.690295\n",
       "1985    1.739410\n",
       "1986    1.799719\n",
       "1987    1.866479\n",
       "Name: lwage, dtype: float64"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.groupby(\"year\")[\"lwage\"].mean()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This means that if we get the average for every person in our panel, we are essentially regressing the individual dummy on the other variables. This motivates the following estimation procedure:\n",
    "\n",
    "1. Create time-demeaned variables by subtracting the mean for the individual:   \n",
    "\\\\(\\ddot{Y}_{it} = Y_{it} -  \\bar{Y}_i\\\\)  \n",
    "\\\\(\\ddot{X}_{it} = X_{it} -  \\bar{X}_i\\\\)\n",
    "2. Regress \\\\(\\ddot{Y}_{it}\\\\) on \\\\(\\ddot{X}_{it}\\\\)\n",
    "\n",
    "Notice that when we do so, the unobserved \\\\(U_i\\\\) vanishes. Since \\\\(U_i\\\\) is constant across time, we have that \\\\(\\bar{U_i}=U_i\\\\). If we have the following system of two equations\n",
    "\n",
    "\\begin{align}\n",
    "Y_{it} & = \\beta X_{it} + \\gamma U_i + e_{it} \\\\\n",
    "\\bar{Y}_{i} & = \\beta \\bar{X}_{it} + \\gamma \\bar{U}_i + \\bar{e}_{it} \\\\\n",
    "\\end{align}\n",
    "\n",
    "And we subtract one from the other, we get\n",
    "\n",
    "\\begin{align}\n",
    "(Y_{it} - \\bar{Y}_{i}) & = (\\beta X_{it} - \\beta \\bar{X}_{it}) + (\\gamma U_i - \\gamma U_i) + (e_{it}-\\bar{e}_{it}) \\\\\n",
    "(Y_{it} - \\bar{Y}_{i}) & = \\beta(X_{it} - \\bar{X}_{it}) + (e_{it}-\\bar{e}_{it}) \\\\\n",
    "\\ddot{Y}_{it} & = \\beta \\ddot{X}_{it} + \\ddot{e}_{it} \\\\\n",
    "\\end{align}\n",
    "\n",
    "which wipes out all unobserved that are constant across time. To be honest, not only do the unobserved variables vanish. This happens to all the variables that are constant in time. For this reason, you can't include any variables that are constant across time, as they would be a linear combination of the dummy variables and the model wouldn't run. \n",
    "\n",
    "![img](./data/img/fixed-effects/demeaned.png)\n",
    "\n",
    "To check which variables are those, we can group our data by individual and get the sum of the standard deviations. If it is zero, it means the variable isn't changing across time for any of the individuals. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "year            1334.971910\n",
       "black              0.000000\n",
       "exper           1334.971910\n",
       "hisp               0.000000\n",
       "hours         203098.215649\n",
       "married          140.372801\n",
       "educ               0.000000\n",
       "union            106.512445\n",
       "lwage            173.929670\n",
       "expersq        17608.242825\n",
       "occupation       739.222281\n",
       "dtype: float64"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.groupby(\"nr\").std().sum()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "For our data, we need to remove entinicity dummies, `black` and `hisp`, since they are constant for the individual. Also, we need to remove education. We will also not use occupation, since this is probably mediating the effect of marriage on wage (it could be that single men are able to take more time demanding positions). Having selected the features we will use, it's time to estimate this model.\n",
    "\n",
    "To run our fixed effect model, first, let's get our mean data. We can achieve this by grouping everything by individuals and taking the mean."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>married</th>\n",
       "      <th>expersq</th>\n",
       "      <th>union</th>\n",
       "      <th>hours</th>\n",
       "      <th>lwage</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>nr</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>0.000</td>\n",
       "      <td>25.5</td>\n",
       "      <td>0.125</td>\n",
       "      <td>2807.625</td>\n",
       "      <td>1.255652</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>0.000</td>\n",
       "      <td>61.5</td>\n",
       "      <td>0.000</td>\n",
       "      <td>2504.125</td>\n",
       "      <td>1.637786</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>1.000</td>\n",
       "      <td>61.5</td>\n",
       "      <td>0.000</td>\n",
       "      <td>2350.500</td>\n",
       "      <td>2.034387</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>45</th>\n",
       "      <td>0.125</td>\n",
       "      <td>35.5</td>\n",
       "      <td>0.250</td>\n",
       "      <td>2225.875</td>\n",
       "      <td>1.773664</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>110</th>\n",
       "      <td>0.500</td>\n",
       "      <td>77.5</td>\n",
       "      <td>0.125</td>\n",
       "      <td>2108.000</td>\n",
       "      <td>2.055129</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     married  expersq  union     hours     lwage\n",
       "nr                                              \n",
       "13     0.000     25.5  0.125  2807.625  1.255652\n",
       "17     0.000     61.5  0.000  2504.125  1.637786\n",
       "18     1.000     61.5  0.000  2350.500  2.034387\n",
       "45     0.125     35.5  0.250  2225.875  1.773664\n",
       "110    0.500     77.5  0.125  2108.000  2.055129"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Y = \"lwage\"\n",
    "T = \"married\"\n",
    "X = [T, \"expersq\", \"union\", \"hours\"]\n",
    "\n",
    "mean_data = data.groupby(\"nr\")[X+[Y]].mean()\n",
    "mean_data.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "To demean the data, we need to set the index of the original data to be the individual identifier, `nr`. Then, we can simply subtract one data frame from the mean data frame."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>married</th>\n",
       "      <th>expersq</th>\n",
       "      <th>union</th>\n",
       "      <th>hours</th>\n",
       "      <th>lwage</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>nr</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>0.0</td>\n",
       "      <td>-24.5</td>\n",
       "      <td>-0.125</td>\n",
       "      <td>-135.625</td>\n",
       "      <td>-0.058112</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>0.0</td>\n",
       "      <td>-21.5</td>\n",
       "      <td>0.875</td>\n",
       "      <td>-487.625</td>\n",
       "      <td>0.597408</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>0.0</td>\n",
       "      <td>-16.5</td>\n",
       "      <td>-0.125</td>\n",
       "      <td>132.375</td>\n",
       "      <td>0.088810</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>0.0</td>\n",
       "      <td>-9.5</td>\n",
       "      <td>-0.125</td>\n",
       "      <td>152.375</td>\n",
       "      <td>0.177561</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>0.0</td>\n",
       "      <td>-0.5</td>\n",
       "      <td>-0.125</td>\n",
       "      <td>263.375</td>\n",
       "      <td>0.312473</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    married  expersq  union    hours     lwage\n",
       "nr                                            \n",
       "13      0.0    -24.5 -0.125 -135.625 -0.058112\n",
       "13      0.0    -21.5  0.875 -487.625  0.597408\n",
       "13      0.0    -16.5 -0.125  132.375  0.088810\n",
       "13      0.0     -9.5 -0.125  152.375  0.177561\n",
       "13      0.0     -0.5 -0.125  263.375  0.312473"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "deamed_data = (data\n",
    "               .set_index(\"nr\") # set the index as the person indicator\n",
    "               [X+[Y]]\n",
    "               - mean_data) # subtract the mean data\n",
    "\n",
    "deamed_data.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Finally, we can run our fixed effect model on the time-demeaned data."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<table class=\"simpletable\">\n",
       "<tr>\n",
       "      <td></td>         <th>coef</th>     <th>std err</th>      <th>t</th>      <th>P>|t|</th>  <th>[0.025</th>    <th>0.975]</th>  \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Intercept</th> <td>-8.327e-17</td> <td>    0.005</td> <td>-1.64e-14</td> <td> 1.000</td> <td>   -0.010</td> <td>    0.010</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>married</th>   <td>    0.1147</td> <td>    0.017</td> <td>    6.756</td> <td> 0.000</td> <td>    0.081</td> <td>    0.148</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>expersq</th>   <td>    0.0040</td> <td>    0.000</td> <td>   21.958</td> <td> 0.000</td> <td>    0.004</td> <td>    0.004</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>union</th>     <td>    0.0784</td> <td>    0.018</td> <td>    4.261</td> <td> 0.000</td> <td>    0.042</td> <td>    0.115</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>hours</th>     <td> -8.46e-05</td> <td> 1.25e-05</td> <td>   -6.744</td> <td> 0.000</td> <td>   -0.000</td> <td>   -6e-05</td>\n",
       "</tr>\n",
       "</table>"
      ],
      "text/plain": [
       "<class 'statsmodels.iolib.table.SimpleTable'>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mod = smf.ols(f\"{Y} ~ {'+'.join(X)}\", data=deamed_data).fit()\n",
    "mod.summary().tables[1]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "If we believe that fixed effect eliminates the all omitted variable bias, this model is telling us that marriage increases a man's wage by 11%. This result is very significant. One detail here is that for fixed effect models, the standard errors need to be clustered. So, instead of doing all our estimation by hand (which is only nice for pedagogical reasons), we can use the library `linearmodels` and set the argument `cluster_entity` to True."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<table class=\"simpletable\">\n",
       "<caption>Parameter Estimates</caption>\n",
       "<tr>\n",
       "     <td></td>     <th>Parameter</th> <th>Std. Err.</th> <th>T-stat</th>  <th>P-value</th> <th>Lower CI</th>  <th>Upper CI</th> \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>expersq</th>  <td>0.0040</td>    <td>0.0002</td>   <td>16.552</td>  <td>0.0000</td>   <td>0.0035</td>    <td>0.0044</td>  \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>union</th>    <td>0.0784</td>    <td>0.0236</td>   <td>3.3225</td>  <td>0.0009</td>   <td>0.0322</td>    <td>0.1247</td>  \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>married</th>  <td>0.1147</td>    <td>0.0220</td>   <td>5.2213</td>  <td>0.0000</td>   <td>0.0716</td>    <td>0.1577</td>  \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>hours</th>   <td>-8.46e-05</td> <td>2.22e-05</td>  <td>-3.8105</td> <td>0.0001</td>   <td>-0.0001</td> <td>-4.107e-05</td>\n",
       "</tr>\n",
       "</table>"
      ],
      "text/plain": [
       "<class 'statsmodels.iolib.table.SimpleTable'>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from linearmodels.panel import PanelOLS\n",
    "mod = PanelOLS.from_formula(\"lwage ~ expersq+union+married+hours+EntityEffects\",\n",
    "                            data=data.set_index([\"nr\", \"year\"]))\n",
    "\n",
    "result = mod.fit(cov_type='clustered', cluster_entity=True)\n",
    "result.summary.tables[1]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Notice how the parameter estimates are identical to the ones we've got with time-demeaned data. The only difference is that the standard errors are a bit larger. Now, compare this to the simple OLS model that doesn't take the time structure of the data into account. For this model, we add back the variables that are constant in time."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<table class=\"simpletable\">\n",
       "<tr>\n",
       "      <td></td>         <th>coef</th>     <th>std err</th>      <th>t</th>      <th>P>|t|</th>  <th>[0.025</th>    <th>0.975]</th>  \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Intercept</th> <td>    0.2654</td> <td>    0.065</td> <td>    4.103</td> <td> 0.000</td> <td>    0.139</td> <td>    0.392</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>expersq</th>   <td>    0.0032</td> <td>    0.000</td> <td>   15.750</td> <td> 0.000</td> <td>    0.003</td> <td>    0.004</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>union</th>     <td>    0.1829</td> <td>    0.017</td> <td>   10.598</td> <td> 0.000</td> <td>    0.149</td> <td>    0.217</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>married</th>   <td>    0.1410</td> <td>    0.016</td> <td>    8.931</td> <td> 0.000</td> <td>    0.110</td> <td>    0.172</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>hours</th>     <td> -5.32e-05</td> <td> 1.34e-05</td> <td>   -3.978</td> <td> 0.000</td> <td>-7.94e-05</td> <td> -2.7e-05</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>black</th>     <td>   -0.1347</td> <td>    0.024</td> <td>   -5.679</td> <td> 0.000</td> <td>   -0.181</td> <td>   -0.088</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>hisp</th>      <td>    0.0132</td> <td>    0.021</td> <td>    0.632</td> <td> 0.528</td> <td>   -0.028</td> <td>    0.054</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>educ</th>      <td>    0.1057</td> <td>    0.005</td> <td>   22.550</td> <td> 0.000</td> <td>    0.097</td> <td>    0.115</td>\n",
       "</tr>\n",
       "</table>"
      ],
      "text/plain": [
       "<class 'statsmodels.iolib.table.SimpleTable'>"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mod = smf.ols(\"lwage ~ expersq+union+married+hours+black+hisp+educ\", data=data).fit()\n",
    "mod.summary().tables[1]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This model is saying that marriage increases the man's wage by 14%. A somewhat larger effect than the one we found with the fixed effect model. This suggests some omitted variable bias due to fixed individual factors, like intelligence and beauty, not being added to the model.\n",
    "\n",
    "## Visualizing Fixed Effects\n",
    "\n",
    "To expand our intuition about how fixed effect models work, let's diverge a little to another example. Suppose you work for a big tech company and you want to estimate the impact of a billboard marketing campaign on in-app purchase. When you look at data from the past, you see that the marketing department tends to spend more to place billboards on cities where the purchase level is lower. This makes sense right? They wouldn't need to do lots of advertisement if sales were skyrocketing. If you run a regression model on this data, it looks like higher cost in marketing leads to less in-app purchase, but only because marketing investments is biased towards low spending regions. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAacAAAEXCAYAAAAJJYvtAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAgAElEQVR4nO3dd3hUZfbA8e8hhNBCqAqClAgoUoSoCFhoKrg2FivoqqC4iG1dy89dUVnErrsqoq4oYndVBGyLKCWCIixGiqgYpEmTABISWkI4vz/uzTAZUu4kM5mb5HyeZ57Mbe89czMzZ9573/u+oqoYY4wxflIt1gEYY4wxoSw5GWOM8R1LTsYYY3zHkpMxxhjfseRkjDHGdyw5GWOM8R1LTqbCEZExIrKqsu2rshCRuSLyUpjbrBWR0dGKyVQ8lpyMr4hILRF5QETSRWSviGwXkf+JyC1Bqz0B9IhVjKUlIt1E5H0RyRCRHPcLebyIHBmy3mQR+aKYchqJyDMiskZE9rvlzRORISXsX93H+YUsm+YuCyupGBMt1WMdgDEhngf6ArcCS4F6QDegZf4KqpoNZMckulISkYHANPdxHrAZOB54EFgsIr1U9VePxU0B6gN/BlYCjYFTgEYetl0PjAA+CoqtGfAHwOv+jYk6qzkZvxkEPK6q01R1jaouVdXJqjo2f4XQU2350yJyqVvj2uPWBOqJyGARWSkiWW6t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GvWrOGOO+5g27Zt1K5dm6effpr27duzZs0aRowYQV5eHmeeeSbPPfccGzduZN68eTz66KM0bdqU5cuX8/XXXzNmzBjmz5/P/v37GTFiBMOGDWPLli0MGzaMrKws8vLyePLJJznllFO46aabWLJkCSLCFVdcwY033sgNN9zAwIEDufDCC0lNTWX06NHk5eXRrVs3/vnPf5KQkEDnzp0ZMmQIM2bM4MCBA0yePJn27dt7er3nnnsu48aNo1u3bjRv3pyRI0cyY8YMEhISeOeddzjiiCPYtm0bt912Gxs2bADg4YcfpkePHuH9I0JYzcn42uiURNokFkxEbRLjGJ3ivdWPMZGSl5dHamoq55xzDgC33norjz32GKmpqTzwwAPcfvvtANx9992MHDmSOXPm0KxZswJlpKWlMXr0aBYuXMjrr79OvXr1mDNnDnPmzOHVV19l7dq1vPfee/Tv35/58+czf/58OnfuzPLly9m8eTMLFizg66+/5oorrihQ7r59+xg1ahSvvPIKX3/9NQcOHODll18OLG/UqBFffvklw4cPZ/z48aV6/bt37+akk07iq6++okePHrz66quB1ztq1CjmzJnDa6+9xi233FKq8oNZzcn4WqvEeKYNaMS4tCxWb88muVFdRqckWmMIU6727t3Laaedxvr16+natSt9+/YlOzubRYsWcfXVVwfWy8nJAWDRokW8+eabAFx88cXce++9gXVSUlJo3bo1ALNnz2bFihVMnz4dgF27drF69WpSUlK46aabyM3N5dxzz6VLly60bt2atWvXcueddzJgwAD69etXIMb09HRatmxJ27ZtARg6dCgTJ05k1KhRAJx//vkAdO3alY8++qhUx6FGjRoMHDgQgC5duvDVV18BMHfu3ALXpbKyssjKygqr6XgoS07G91olxjOxd0PS07fTrl3LWIdjqqD8a06ZmZlcfvnlTJw4kaFDh5KUlMT8+fPDKqtOnTqB56rKY489Rv/+/Q9b79NPP2XmzJmMHDmSm2++mSFDhjB//nxmzZrFxIkTmTp1KhMmTChQVnESEhIAiIuL48CBA2HFnC8+Pj5wI21wOQcPHuTzzz+nVq1apSq3MJacjDEVSrjXiCIpKSmJRx55hCuuuIJrr72W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LviPVtUk4AVAQospZLuzgdEiEnxB/lfgHFWtH/So6Z4GKmtPx5uBFkHTRxez7gJgH8Wf+tuEk0zztXTnoapZqnq7qiYD5wN/FZH+7noFXodbs/qHqh6PMxbReTg11cIsA9oXE1NEuDXLzTinK/OdAKxwn68IXuaO1nsMsMLDtojIUUANSj5FaSogS06mPF0L9HOvLYRKBHao6j4R6Y5Ty/JiBc61kQkicoE77wXgwfxmySLSRETyW8dl4DQmSC7la3gXuFVEmotIfeD/ilpRVTOB+9zYBrnjBcWLyDki8pi72ts4ybWJ23rtPtzrcSJynoi0dccY2oVT+8tzt/st+DWISF8R6exe09uFc5ovf91Qn3L4KdNSE5GaOA07ABLc6Xyv4by+BiJyHM41u8nusqlAJxG5yN3mPmCZqv7kYVtwGnLMdk/dmkrGkpMpN6r6i6ouLmLxKGCsiGThfEm9G0a5S3FqChNF5BzgaZxa2Ey3vG+AU9x19wAPAl+5p/16hPkyJgIzcWof3+F80R+giESgzmCSf8Vp5JCBU6u7CZjmrjIOpwn1MmA5zphC49xl7YAvcE5xLQCeU9W57rKHcb64d4rIHUBTnBFvd+Gcxkzl8EYn+V4D/iAipW7OHyK/1SA41xODrwnej9PIYZ0b0+OqOgPAvcZ2Ec7/43ec/9HlXrZ1XYHzQ8RUQjaekzFl4CbDF1S1VYkr+4iIPARsVdWnYh1Labj3yr2oqj1jHYuJDktOxoTBrW30xak9HQlMAb5R1b/ENDBjKhlLTsaEQURq45xiOg7n9NUnwK3FNNs2xpSCJSdjjDG+Yw0ijDHG+I4lJ2OMMb5jyckYY4zvWHIyxhjjO5acjDHG+I4lJ2OMMb7z/8MLB4qQpP8uAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "toy_panel = pd.DataFrame({\n",
    "    \"mkt_costs\":[5,4,3.5,3, 10,9.5,9,8, 4,3,2,1, 8,7,6,4],\n",
    "    \"purchase\":[12,9,7.5,7, 9,7,6.5,5, 15,14.5,14,13, 11,9.5,8,5],\n",
    "    \"city\":[\"C0\",\"C0\",\"C0\",\"C0\", \"C2\",\"C2\",\"C2\",\"C2\", \"C1\",\"C1\",\"C1\",\"C1\", \"C3\",\"C3\",\"C3\",\"C3\"]\n",
    "})\n",
    "\n",
    "m = smf.ols(\"purchase ~ mkt_costs\", data=toy_panel).fit()\n",
    "\n",
    "plt.scatter(toy_panel.mkt_costs, toy_panel.purchase)\n",
    "plt.plot(toy_panel.mkt_costs, m.fittedvalues, c=\"C5\", label=\"Regression Line\")\n",
    "plt.xlabel(\"Marketing Costs (in 1000)\")\n",
    "plt.ylabel(\"In-app Purchase (in 1000)\")\n",
    "plt.title(\"Simple OLS Model\")\n",
    "plt.legend();"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Knowing a lot about causal inference, you decide to run a fixed effect model, adding the cities indicator as a dummy variable to your model. The fixed effect model controls for city specific characteristics that are constant in time, so if a city is less open to your product, it will capture that. When you run that model, you can finally see that more marketing costs leads to higher in-app purchase."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAacAAAEXCAYAAAAJJYvtAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAgAElEQVR4nOzdeXxU9dXH8c/JHgIJ+75DQHZUFEFZAglga7Wbtlrr0qe2PrbWPhVcqtZdpKDVulSrtVpttVZrrbYEwi77vm9h3yEsCWuWmTnPH3eAITNJBsjkTpLzfr3mRXJ/d+49MyQ5872rqCrGGGNMNIlxuwBjjDGmNGtOxhhjoo41J2OMMVHHmpMxxpioY83JGGNM1LHmZIwxJupYczLVhog8ISK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yR1S7pUpt0ig2tH6V7rp+zHSeqRtLWcMTRFZn8/y3Xvp9+DpC5Ju8qe3hRZ5qvPbXSfmSXTtklaSTZ2AKwor+tGyPtbK6mT3LO7WcbuADsl9ZZr+oGJiHjdxLWQjRyPSunWlhgHJ1swEfEmIp7PMnwcOC/pK/mQGm3hfV+SmcKwpG7gKpmFjZX3Gwf2lrnfgEHgaSn77WvxNoaBMTL7eEE+6H8wSyCIPEzyFNnkMElmdSeAu2XKANlCPQG8Is8UGihj24CHZInrGXA9Ih6XsYvkg/uzpNPAevLE2ymyjPmEmU0ndSPAQUltt/M3qHcNQu4nTt8TPEs2Obwta7ocEQ8Ayh5bL/l5fCI/oyPNXFscJb+I2BLk85zM/kAJhkMRsWneyRUi6QLwISKuLPZa2lF+K3cjIvYv9lrs33BwMmtByTa6yOxpHXAbGI+Ik4u6MLMlxsHJrAWSVpElpk6yfHUP6JujbdvM2uDgZGZmleOGCDMzqxwHJzMzqxwHJzMzqxwHJzMzqxwHJzMzqxwHJzMzq5xffOethJLCVWUAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fe = smf.ols(\"purchase ~ mkt_costs + C(city)\", data=toy_panel).fit()\n",
    "\n",
    "fe_toy = toy_panel.assign(y_hat = fe.fittedvalues)\n",
    "\n",
    "plt.scatter(toy_panel.mkt_costs, toy_panel.purchase, c=toy_panel.city)\n",
    "for city in fe_toy[\"city\"].unique():\n",
    "    plot_df = fe_toy.query(f\"city=='{city}'\")\n",
    "    plt.plot(plot_df.mkt_costs, plot_df.y_hat, c=\"C5\")\n",
    "\n",
    "plt.title(\"Fixed Effect Model\")\n",
    "plt.xlabel(\"Marketing Costs (in 1000)\")\n",
    "plt.ylabel(\"In-app Purchase (in 1000)\");"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Take a minute to appreciate what the image above is telling you about what fixed effect is doing. Notice that fixed effect is fitting **one regression line per city**. Also notice that the lines are parallel. The slope of the line is the effect of marketing costs on in-app purchase. So the **fixed effect is assuming that the causal effect is constants across all entities**, which are cities in this case. This can be a weakness or an advantage, depending on how you see it. It is a weakness if you are interested in finding the causal effect per city. Since the FE model assumes this effect is constant across entities, you won't find any difference in the causal effect. However, if you want to find the overall impact of marketing on in-app purchase, the panel structure of the data is a very useful leverage that fixed effects can explore. \n",
    "\n",
    "## Time Effects\n",
    "\n",
    "Just like we did a fixed effect for the individual level, we could design a fixed effect for the time level. If adding a dummy for each individual controls for fixed individual characteristics, adding a time dummy would control for variables that are fixed across time. One example of such a variable is inflation. Prices and salary tend to go up with time. If the wage and marriage proportion also changes with time, we would have time as a confounder. To give a more concrete example, suppose that marriage is increasing with time. Since inflation also makes salary increase with time, some of the positive association we see between marriage and wage would be simply because both are increasing with time. To correct for that, we can add a dummy variable for each time period. In `linear models`, this is as simple as adding `TimeEffects` to our formula and setting the `cluster_time` to true."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<table class=\"simpletable\">\n",
       "<caption>Parameter Estimates</caption>\n",
       "<tr>\n",
       "     <td></td>     <th>Parameter</th> <th>Std. Err.</th> <th>T-stat</th>  <th>P-value</th> <th>Lower CI</th>  <th>Upper CI</th> \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>expersq</th>  <td>-0.0062</td>   <td>0.0008</td>   <td>-8.1479</td> <td>0.0000</td>   <td>-0.0077</td>   <td>-0.0047</td> \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>union</th>    <td>0.0727</td>    <td>0.0228</td>   <td>3.1858</td>  <td>0.0015</td>   <td>0.0279</td>    <td>0.1174</td>  \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>married</th>  <td>0.0476</td>    <td>0.0177</td>   <td>2.6906</td>  <td>0.0072</td>   <td>0.0129</td>    <td>0.0823</td>  \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>hours</th>    <td>-0.0001</td>  <td>3.546e-05</td> <td>-3.8258</td> <td>0.0001</td>   <td>-0.0002</td> <td>-6.614e-05</td>\n",
       "</tr>\n",
       "</table>"
      ],
      "text/plain": [
       "<class 'statsmodels.iolib.table.SimpleTable'>"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mod = PanelOLS.from_formula(\"lwage ~ expersq+union+married+hours+EntityEffects+TimeEffects\",\n",
    "                            data=data.set_index([\"nr\", \"year\"]))\n",
    "\n",
    "result = mod.fit(cov_type='clustered', cluster_entity=True, cluster_time=True)\n",
    "result.summary.tables[1]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In this new model, the effect of marriage on wage decreased significantly from `0.1147` to `0.0476`. Still, this result is significant at a 99% level, so man could still expect an increase in earnings from marriage. \n",
    "\n",
    "## When Panel Data Won't Help You\n",
    "\n",
    "Using panel data and fixed effects models is an extremely powerful tool for causal inference. When you don't have random data nor good instruments, the fixed effect is as convincing as it gets for causal inference with non experimental data. Still, it is worth mentioning that it is not a panacea. There are situations where even panel data won't help you.\n",
    "\n",
    "The most obvious one is when you have confounders that are changing in time. Fixed Effects can only eliminate bias from attributes that are constant for each individual. For instance, suppose that you can increase your intelligence level by reading books and eating lots of good fats. This causes you to get a higher paying job and a wife. Fixed effect won't be able to remove this bias due to unmeasured intelligence confounding because, in this example, intelligence is changing in time. \n",
    "\n",
    "![img](./data/img/fixed-effects/time-travel.png)\n",
    "\n",
    "Another less obvious case when fixed effect fails is when you have **reversed causality**. For instance, let's say that it isn't marriage that causes you to earn more. Is earning more that increases your chances of getting married. In this case, it will appear that they have a positive correlation but earnings come first. They would change in time and in the same direction, so fixed effects wouldn't be able to control for that. \n",
    "\n",
    "\n",
    "## Key Ideas\n",
    "\n",
    "Here, we saw how to use panel data, data where we have multiple measurements of the same individuals across multiple time periods. When that is the case, we can use a fixed effect model that controls for the entity, holding all individual, time constant attributes, fixed. This is a powerful and very convincing way of controlling for confounding and it is as good as it gets with non random data. \n",
    "\n",
    "Finally, we saw that FE is not a panacea. We understood two situations where it doesn't work: when we have reverse causality and when the unmeasured confounding is changing in time.\n",
    "\n",
    "\n",
    "\n",
    "## References\n",
    "\n",
    "I like to think of this entire book as a tribute to Joshua Angrist, Alberto Abadie and Christopher Walters for their amazing Econometrics class. Most of the ideas here are taken from their classes at the American Economic Association. Watching them is what is keeping me sane during this tough year of 2020.\n",
    "* [Cross-Section Econometrics](https://www.aeaweb.org/conference/cont-ed/2017-webcasts)\n",
    "* [Mastering Mostly Harmless Econometrics](https://www.aeaweb.org/conference/cont-ed/2020-webcasts)\n",
    "\n",
    "I'll also like to reference the amazing books from Angrist. They have shown me that Econometrics, or 'Metrics as they call it, is not only extremely useful but also profoundly fun.\n",
    "\n",
    "* [Mostly Harmless Econometrics](https://www.mostlyharmlesseconometrics.com/)\n",
    "* [Mastering 'Metrics](https://www.masteringmetrics.com/)\n",
    "\n",
    "Another important reference is Miguel Hernan and Jamie Robins' book. It has been my trustworthy companion in the most thorny causal questions I had to answer.\n",
    "\n",
    "* [Causal Inference Book](https://www.hsph.harvard.edu/miguel-hernan/causal-inference-book/)\n",
    "\n",
    "Finally, I'd also like to compliment Scott Cunningham and his brilliant work mingling Causal Inference and Rap quotes:\n",
    "\n",
    "* [Causal Inference: The Mixtape](https://www.scunning.com/mixtape.html)\n",
    "\n",
    "![img](./data/img/poetry.png)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
